import { defineStore } from 'pinia'

interface IRouteState {
  /** 权限路由的模式(static|dynamic) */
  routeMode: ImportMetaEnv['VITE_ROUTE_MODE']
  /** 是否初始化权限路由的生成 */
  isInitRoute: boolean
  /** 菜单渲染数据 */
  menus: App.Menu[]
  /** 缓存的路由 */
  cacheList: string[]
}

export const useRouteStore = defineStore({
  id: 'route',
  state: (): IRouteState => ({
    routeMode: import.meta.env.VITE_ROUTE_MODE,
    isInitRoute: false,
    menus: [],
    cacheList: []
  }),
  actions: {
    initRoute() {}
  }
})
